Steadily over time computers have become much more powerful, with more processing power and memory to handle advanced operations. This trend has recently shifted away from a focus on ever-increasing single-processor clock rates and towards an increase in the number of processors available in a single computer. Software developers want to take advantage of improvements in computer processing power, enabling their software programs to be executed faster as new hardware is adopted. With the new hardware trends, however, this requires a different approach: developers must arrange for one or more tasks of a particular software program to be executed “concurrently” (sometimes called “in parallel”), so that the same logical operation can utilize many processors at one time, and deliver better performance as more processors are added to the computers on which such software runs.
Transactional memory is designed to ease development of concurrent programs by providing atomicity and isolation to regions of program code. Transactional memory (TM) is a concurrency control mechanism analogous to database transactions for controlling access to shared memory in concurrent computing. A transaction in the context of transactional memory is a piece of code that executes a series of reads and writes to shared memory. TM is used as an alternative to traditional locking mechanisms. TM allows concurrent programs to be written more simply. A transaction specifies a sequence of code that is supposed to execute as if it were executing in isolation, whereas in reality it executes in a normal multithreaded environment with many concurrent activities. This illusion of isolation may be achieved by fine-grained locking of objects or memory ranges, and by executing in a mode that allows the effects of the transaction to be rolled back if the transaction is discovered to be in conflict with some other transaction. We say that a data access is “transacted” if the access is protected by these locking and rollback mechanisms.
Different locking and versioning mechanisms are possible, including several software-based and hardware-based approaches. Different mechanisms have features and qualities making each suitable or preferable in different situations. Combining different mechanisms within a single process generally is not possible, leading to the selection of generic mechanisms which typically compromise on performance in order to achieve general applicability.